<?php
// =====================================================
// AnthroHeart Universe - The Complete Cinematic Master
// =====================================================

// 1. CACHE BUSTING
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Pragma: no-cache");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

// 2. HIGH-INTEGRITY COUNTER (SHA256 Unique IP)
$counter_file = __DIR__ . '/visitors.txt';
$unique_file  = __DIR__ . '/unique_visitors.txt';
if (!file_exists($counter_file)) { file_put_contents($counter_file, "1"); }
if (!file_exists($unique_file)) { file_put_contents($unique_file, serialize([])); }
$count = (int)file_get_contents($counter_file);
$visitor_key = hash('sha256', $_SERVER['REMOTE_ADDR'] . date('Y-m-d'));
$unique_visitors = unserialize(file_get_contents($unique_file));
if (!is_array($unique_visitors)) { $unique_visitors = []; }
if (!in_array($visitor_key, $unique_visitors)) {
    $unique_visitors[] = $visitor_key;
    $count++;
    file_put_contents($counter_file, (string)$count);
    file_put_contents($unique_file, serialize($unique_visitors));
}

// 3. REAL-TIME SPEED (Remote Fetch from IONOS Node)
function get_node_speed() {
    $url = 'https://www.anthroheart.com/speed.txt';
    $ctx = stream_context_create(['http' => ['timeout' => 2]]);
    $data = @file_get_contents($url, false, $ctx);
    if ($data === false) return "0.00";
    $filtered = preg_replace('/[^0-9.]/', '', $data);
    return (!empty($filtered)) ? substr($filtered, 0, 8) : "0.00";
}
$live_speed = get_node_speed();

// 4. SEO
$site_url = "https://anthroheart.com";
$preview_img = $site_url . "/blueheart.png";
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>AnthroHeart Universe – A Public Domain Mythos</title>
  
  <meta name="description" content="147 songs · 23 characters · 100% Public Domain. High-velocity Bitcoin notarized archive.">
  <meta property="og:image" content="<?= $preview_img ?>">
  <meta name="twitter:card" content="summary_large_image">

  <link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Montserrat:wght@400;600&family=Fira+Code&display=swap" rel="stylesheet">
  
  <style>
    :root {
      --gold: #d4af37;
      --gold-glow: rgba(212,175,55,0.4);
      --bg-dark: #0f0a05;
      --text-color: #ffebcd;
      --terminal-green: #00ff00;
      --metlife-blue: #0071c5;
    }

    /* --- Cinematic PDF Slider --- */
    .deck-container {
      position: relative;
      max-width: 800px;
      margin: 40px auto;
      border: 3px solid var(--gold);
      border-radius: 15px;
      overflow: hidden;
      background: #000;
      box-shadow: 0 0 50px rgba(0,0,0,0.8);
    }
    #deck-image {
      width: 100%;
      display: block;
      width: 100%;
      min-height: 400px; /* Keeps the box from collapsing */
      background: #111;
      transition: opacity 0.3s ease;
    }
    .deck-controls {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px 20px;
      background: rgba(20, 15, 5, 0.9);
      border-top: 1px solid var(--gold);
    }
    .deck-btn {
      background: var(--gold);
      color: #000;
      border: none;
      padding: 8px 20px;
      border-radius: 5px;
      font-weight: bold;
      cursor: pointer;
      font-family: 'Cinzel', serif;
    }
    .deck-btn:hover { background: #fff; }
    #page-indicator { font-family: 'Fira Code', monospace; color: var(--gold); }

    body { margin:0; font-family:'Montserrat', sans-serif; background: var(--bg-dark); color: var(--text-color); line-height: 1.6; overflow-x: hidden; }
    .container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
    
    /* --- Sections --- */
    section { padding: 80px 0; border-bottom: 1px solid rgba(212,175,55,0.1); }
    h1, h2, h3 { font-family: 'Cinzel', serif; text-align: center; color: var(--gold); text-shadow: 0 0 15px var(--gold-glow); margin-top: 0; }
    
    /* --- Hero Marquee --- */
    .marquee-hero { position: relative; width: 100%; height: 75vh; min-height: 550px; background: #000; border-bottom: 5px solid var(--gold); overflow: hidden; }
    .marquee-frame { position: absolute; inset: 0; z-index: 3; pointer-events: none; border: 15px solid var(--gold); box-shadow: 0 0 50px rgba(0,0,0,0.9) inset, 0 0 30px var(--gold-glow); }
    .hero-overlay { position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); text-align:center; z-index:5; width:90%; }

    /* --- Telemetry HUD --- */
    .telemetry-container { background: rgba(20, 20, 20, 0.85); border: 1px solid var(--gold); border-radius: 15px; padding: 30px; backdrop-filter: blur(10px); box-shadow: 0 0 40px rgba(0, 0, 0, 0.8); margin: 20px 0; }
    .telemetry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
    .telemetry-card { background: rgba(0, 255, 0, 0.02); border: 1px solid rgba(0, 255, 0, 0.2); padding: 15px; border-radius: 8px; text-align: center; }
    .telemetry-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); display: block; margin-bottom: 5px; }
    .telemetry-value { font-family: 'Fira Code', monospace; font-size: 1.4rem; color: var(--terminal-green); text-shadow: 0 0 10px rgba(0, 255, 0, 0.4); }

    /* --- Content Blocks --- */
    .golden-box { background: linear-gradient(180deg,#1a0f06,#2b1b0a); border: 2px solid var(--gold); border-radius: 18px; padding: 40px; box-shadow: 0 0 30px rgba(212,175,55,0.2); margin: 40px 0; }
    .terminal { background: #001a00; border: 1px solid var(--terminal-green); border-radius: 8px; padding: 20px; font-family: 'Fira Code', monospace; color: var(--terminal-green); font-size: 0.9em; }
    
    /* --- Access Nodes --- */
    .node-card { flex:1; min-width:300px; background:rgba(212,175,55,0.05); border: 2px solid var(--gold); padding: 30px; text-align: center; text-decoration: none; color: inherit; border-radius: 15px; transition: 0.3s; }
    .node-card:hover { transform: translateY(-5px); box-shadow: 0 0 30px var(--gold); background:rgba(212,175,55,0.15); }

    /* --- Media --- */
    img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 20px auto; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
    .video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 15px; border: 2px solid var(--gold); margin: 30px 0; }
    .video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

    /* --- Buttons --- */
    .btn-gold { display: inline-block; padding: 18px 45px; background: linear-gradient(45deg,#b8860b,#ffd700); color: #2b1b0a; font-size: 20px; font-weight: bold; text-decoration: none; border-radius: 50px; transition: 0.3s; box-shadow: 0 10px 30px rgba(255,215,0,0.3); border: none; cursor: pointer; }
    .btn-gold:hover { transform: scale(1.05); box-shadow: 0 15px 40px rgba(255,215,0,0.5); }

    /* --- Visitor Counter Style --- */
    .counter-display {
      background: #000; border: 3px solid #1a1a1a; border-radius: 15px; padding: 30px;
      display: inline-block; box-shadow: 0 0 20px rgba(0,255,0,0.1), inset 0 0 15px rgba(0,255,0,0.05);
      margin: 40px 0; text-align: center;
    }
    .counter-number {
      font-family: 'Fira Code', monospace; font-size: 4rem; color: var(--terminal-green);
      text-shadow: 0 0 20px var(--terminal-green); line-height: 1; margin-bottom: 10px; display: block;
    }
    .counter-label { font-family: 'Cinzel', serif; color: var(--gold); letter-spacing: 3px; font-size: 0.9rem; text-transform: uppercase; }

    footer { background: #000; padding: 100px 20px; text-align: center; border-top: 5px solid var(--gold); }
  </style>
</head>
<body>

  <!-- HERO VIDEO -->
  <div class="marquee-hero">
    <div class="marquee-frame"></div>
    <iframe src="https://www.youtube.com/embed/l93bUo1imXE?autoplay=1&mute=1&loop=1&playlist=l93bUo1imXE&controls=0&modestbranding=1" style="width:100%; height:100%; border:none;" allow="autoplay; encrypted-media"></iframe>
    <div class="hero-overlay">
        <h1 style="font-size: clamp(2rem, 10vw, 4.5rem); margin:0;">AnthroHeart Universe</h1>
        <p style="font-size: 1.2rem; background:rgba(0,0,0,0.8); display:inline-block; padding:10px 40px; border-radius:50px; border:2px solid var(--gold); color: #fff; margin-top: 20px;">A Public Domain Gift to Humanity</p>
    </div>
  </div>

  <div class="container">

    <!-- TELEMETRY -->
    <section>
      <div class="telemetry-container">
        <h3>🛰️ SATELLITE TELEMETRY</h3>
        <div class="telemetry-grid">
          <div class="telemetry-card">
            <span class="telemetry-label">Seeding Velocity</span>
            <div class="telemetry-value"><?= $live_speed ?><small style="font-size:0.5em; margin-left:5px;">Mbps</small></div>
          </div>
          <div class="telemetry-card">
            <span class="telemetry-label">Uplink Capacity</span>
            <div class="telemetry-value">1,500.00<small style="font-size:0.5em; margin-left:5px;">Mbps</small></div>
          </div>
          <div class="telemetry-card">
            <span class="telemetry-label">Node Status</span>
            <div class="telemetry-value" style="font-size: 1.1rem;">BBR-OPTIMIZED</div>
          </div>
          <div class="telemetry-card">
            <span class="telemetry-label">Ledger Anchor</span>
            <div class="telemetry-value" style="font-size: 1.1rem;">BLOCK 929481</div>
          </div>
        </div>
      </div>
    </section>

    <!-- MISSION -->
    <section>
      <h2>The Core Purpose</h2>
      <div class="golden-box">
        <p style="font-size:1.2rem; text-align:center; margin-bottom: 30px;"><strong>AnthroHeart is a complete “Studio-in-a-Box” creative franchise released fully into the Public Domain.</strong></p>
        <p>This includes 147 songs, 23 characters, and a massive trilogy of lore. Released openly so the soul of this universe can live in the hands of the people forever.</p>
        <div style="background: rgba(0,0,0,0.4); padding:20px; border-radius:10px; margin-top:30px; font-style:italic; text-align:center; border: 1px solid var(--gold-glow);">
          "I have awakened from the Dream and now walk in the Completion Field."
        </div>
      </div>
    </section>

    <!-- NODES -->
    <section>
      <h2>✦ THE ACCESS NODES ✦</h2>
      <div style="display: flex; flex-wrap: wrap; justify-content: center; gap: 25px; margin-top: 40px;">
        <a href="https://anthroheart.com/index.php" class="node-card">
          <div style="font-size:3.5rem; margin-bottom: 15px;">📦</div>
          <h3 style="margin-bottom: 10px;">Genesis Bundle</h3>
          <p style="font-size: 0.9em; opacity: 0.8;">The 5.33GB Full Archive (7z, Torrent, Bitcoin Proofs)</p>
        </a>
        <a href="http://archive.anthroentertainment.com" target="_blank" class="node-card">
          <div style="font-size:3.5rem; margin-bottom: 15px;">🏛️</div>
          <h3 style="margin-bottom: 10px;">Internet Archive</h3>
          <p style="font-size: 0.9em; opacity: 0.8;">Permanent Global Mirror & Browser Preview</p>
        </a>
      </div>
    </section>

    <!-- ART -->
    <section>
      <h2>Memories in My Pencil</h2>
      <img src="images/SherryDrawing.jpg" alt="Sherry Drawing" style="max-width:550px; border: 4px solid var(--gold);">
      <p style="text-align:center; font-style:italic; color:var(--gold); margin-top: 15px;">Sherry: "Kiss my rose." — Graphite on paper by Thomas B Sweet.</p>
      <p style="margin-top: 30px;">Every story in this bundle started with real human connections. From Kelly Stricker and her quarter horses to the industrial printer rubber-band wars. While the world got weird, I stayed home and built this universe to ensure these frequencies belong to the world, not a corporation.</p>
    </section>

    <!-- COMPUTING -->
    <section>
      <h2>The Beast of '88</h2>
      <img src="images/computer.jpg" alt="VTech PreComputer 1000" style="max-width:650px; border: 3px solid #4169e1; filter: brightness(0.8);">
      <p style="text-align:center; color:#87cefa; margin-top: 15px;">VTech PreComputer 1000 · 2 KB RAM · Where it began.</p>
      <div class="terminal" style="margin: 30px auto; max-width: 600px;">
        10 PRINT "How many French fries did you eat?"<br>
        20 INPUT F<br>
        30 PRINT "How many inches was each French fry?"<br>
        40 INPUT I<br>
        50 PRINT "You just ate a "; F*I;" inch French fry."<br>
        60 END
      </div>
    </section>

<!-- INTERACTIVE PITCH DECK VIEWER -->
    <section>
      <h2>The Disney Pitch Deck</h2>
      <p style="text-align:center; margin-bottom: 20px;">Genesis of the 14 Trillion: The 14-Page Sovereign Blueprint</p>
      
      <div class="deck-container">
        <!-- We hard-code the first slide here so it appears instantly -->
        <img src="images/deck/slide-01.png" id="deck-image" alt="AnthroHeart Pitch Slide">
        
        <div class="deck-controls">
          <button class="deck-btn" onclick="changePage(-1)">PREV</button>
          <span id="page-indicator">PAGE 1 / 14</span>
          <button class="deck-btn" onclick="changePage(1)">NEXT</button>
        </div>
      </div>

      <div style="text-align:center; margin-top: 20px;">
         <a href="AnthroHeart_Pitch_Deck.pdf" target="_blank" class="btn-gold" style="font-size: 1rem; padding: 10px 30px;">Download PDF Raw</a>
      </div>
    </section>

<script>
  let currentPage = 1;
  const totalPages = 14;

  function changePage(step) {
    const img = document.getElementById('deck-image');
    const indicator = document.getElementById('page-indicator');
    
    currentPage += step;
    
    // Loop logic
    if (currentPage < 1) currentPage = totalPages;
    if (currentPage > totalPages) currentPage = 1;
    
    // IMPORTANT: Most pdftoppm outputs for 14 pages use 1-digit numbers
    // But if slide-01 worked for you, we keep the zero logic.
    // This line tries to find slide-01, slide-02...
    let pageStr = (currentPage < 10) ? "0" + currentPage : currentPage;
    
    img.style.opacity = 0.2;
    
    // Change the source - check your FileZilla to see if there is a '0'
    // If clicking NEXT fails again, change "slide-" + pageStr to "slide-" + currentPage
    img.src = 'images/deck/slide-' + pageStr + '.png';
    
    indicator.innerText = 'PAGE ' + currentPage + ' / ' + totalPages;
    
    img.onload = function() {
        img.style.opacity = 1;
    };
  }
</script>

    <!-- CREDITS -->
    <section>
      <h2>Investment & Evolution</h2>
      <div class="golden-box" style="padding: 30px;">
        <h3 style="font-size: 1.5rem; margin-bottom: 10px;">Total Invested: $21,815.01 USD</h3>
        <p style="font-size: 0.9em; opacity: 0.7; margin-bottom: 25px;">A legacy funded by devotion and human craftsmanship.</p>
        <div class="scroll-box">
          <ul style="list-style: none; padding: 0; text-align: left;">
            <li style="margin-bottom:12px; border-bottom: 1px solid rgba(212,175,55,0.1); padding-bottom: 8px;">✦ Marketing & Publishing (Gregory Bair, MBA - $8,524)</li>
            <li style="margin-bottom:12px; border-bottom: 1px solid rgba(212,175,55,0.1); padding-bottom: 8px;">✦ Fursuit Build (The Karelia Fursuits - $3,000)</li>
            <li style="margin-bottom:12px; border-bottom: 1px solid rgba(212,175,55,0.1); padding-bottom: 8px;">✦ Redo TheWarlockName.com (Nicolas H. - $1,323)</li>
            <li style="margin-bottom:12px; border-bottom: 1px solid rgba(212,175,55,0.1); padding-bottom: 8px;">✦ Traditional Art Commissions (Nicolas S., @orbnorsolya)</li>
            <li style="margin-bottom:12px; border-bottom: 1px solid rgba(212,175,55,0.1); padding-bottom: 8px;">✦ Android App Updates & CUDA Optimization</li>
            <li style="margin-bottom:12px; border-bottom: 1px solid rgba(212,175,55,0.1); padding-bottom: 8px;">✦ Novel & Poetry Publication (2018-2025)</li>
          </ul>
        </div>
      </div>
    </section>

    <!-- SOVEREIGNTY -->
    <section>
      <h2>🐾 Sovereignty over Debt</h2>
      <p style="text-align:center;">I said no to predatory 126% interest loans. Just real support for a real dream.</p>
      <div style="text-align:center; margin-top:40px;">
        <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=healing@intentionrepeater.com&currency_code=USD" class="btn-gold">SUPPORT THE LEGACY</a>
      </div>
    </section>

    <!-- METLIFE -->
    <section style="border-bottom: none;">
      <div style="background:#fff; color:#111; padding:40px; border-radius:15px; border-left:12px solid var(--metlife-blue); box-shadow: 0 10px 40px rgba(0,0,0,0.4);">
        <h2 style="color:var(--metlife-blue); text-align:left; text-shadow:none;">Thank You, MetLife</h2>
        <p style="font-size: 1.1rem; line-height: 1.8;">"Get Met. It Pays." — MetLife delivered on their promise during my most challenging chapter, allowing me to build toward independence and launch this business. Deeply grateful.</p>
        <p style="text-align:right; font-style:italic; margin-top: 20px; color: #555;">– Anthro Entertainment LLC</p>
      </div>
    </section>

  </div>

  <footer>
    <div class="container">
      
      <!-- ENHANCED VISITOR COUNTER -->
      <div class="counter-display">
        <span class="counter-number"><?php echo number_format($count); ?></span>
        <span class="counter-label">Global Discovery Events</span>
      </div>

      <p style="margin-top: 40px;">© 2025 Thomas B Sweet · Public Domain · Anchored to Bitcoin Block 929481</p>
      <p style="opacity:0.4; font-size:0.8rem; font-family: 'Fira Code';">Node ID: 69.48.205.55 | IONOS High-Velocity Backbone | BBR-Optimized</p>
    </div>
  </footer>

</body>
</html>
